<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8" />
		<link rel="stylesheet" type="text/css" href="/admin/css/wangjimima.css"/>
		<!--引用jquery库-->
		<script src="/admin/js/jquery.js" type="text/javascript" charset="utf-8"></script>
		<!--引用bootstrapjs-->
		<script src="/admin/js/xiugai.js" type="text/javascript" charset="utf-8"></script>
		<title></title>
	</head>
	<body>
		{{csrf_field()}}
		<input type="hidden" id="agentId" value="{{$agentId}}">
		<div class="header">
			<img src="/admin/images/logo1.png"/>
			<p>已有账号？去<a href="login.html">登录</a></p>
		</div>
		<div class="body">
			<p>忘记密码</p>
			<div class="first information">
				<label for="" class="title">新密码：</label>
				<input type="password" id="pass" class="input" placeholder="请输入新密码"/>
				<div class="tishi">
					
				</div>
			</div>
			<div class="information">
				<label for="" class="title">重复密码：</label>
				<input type="password" id="pass1" value="" class="input" placeholder="重复输入密码"/>
				<div class="tishi">
					
				</div>
			</div>
			<div class="information">
				<p><input type="button" id="btn" value="提交"/></p>
			</div>
		</div>
		<div class="footer">
			<p>© 2017 郑州全一安防科技有限公司 版权所有</p>			
		</div>
	</body>
</html>
<script>
    $('#btn').click(function () {
        var agentId = $('#agentId').val();
        var pass = $('#pass').val();
        var pass1 = $('#pass1').val();
        if(pass == pass1 && pass != ''){
            $.ajax({
                type:'post',
                url:'/admin/login/change',
                async:false,
                data:{
                    "_token": $("input[name=_token]").val(),
                    'agentId':agentId,
                    'pass':pass
                },
                dataType:'json',
                success:function (data) {
                    alert(data.msg)
                    if(data.status == '1'){
                        location.href = 'index'
                    }
                }
            });
        }

    })
</script>
